﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace MMS.UI.Areas.Admin.ViewModels
{
    public class LevelModel
    {
        public int LId { get; set; }
        [DisplayName("会员等级名称"), Required(ErrorMessage = "会员等级名称不能为空")]
        /// <summary>
        /// 会员等级名称
        /// </summary>
        public string LName { get; set; }

        [DisplayName("会员升级消费额"), Required(ErrorMessage = "会员升级消费额不能为空")]
        /// <summary>
        /// 会员升级消费额
        /// </summary>
        public decimal LUpGradeAmount { get; set; }

        [DisplayName("会员等级折扣"), Required(ErrorMessage = "会员等级折扣不能为空")]
        /// <summary>
        /// 会员等级折扣
        /// </summary>
        public double? LDiscount { get; set; }

        [DisplayName("积分比率"), Required(ErrorMessage = "积分比率不能为空")]
        /// <summary>
        /// 积分比率
        /// </summary>
        public double? LIntegralRatio { get; set; }
        [DisplayName("备注说明")]
        /// <summary>
        /// 备注说明
        /// </summary>
        public string LRemark { get; set; }

        public MMS.Model.Level ToModel()
        {
            return new MMS.Model.Level()
            {
                LId = this.LId,
                LName = this.LName,
                LUpGradeAmount = this.LUpGradeAmount,
                LDiscount = this.LDiscount,
                LIntegralRatio = this.LIntegralRatio,
                LRemark = this.LRemark,

            };
        }
    }
}